Integrand size = 23, antiderivative size = 82 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {(a-b)^2 \log (\cos (e+f x))}{f}+\frac {(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac {(2 a-b) b \tan ^4(e+f x)}{4 f}+\frac {b^2 \tan ^6(e+f x)}{6 f} \]
(a-b)^2*ln(cos(f*x+e))/f+1/2*(a-b)^2*tan(f*x+e)^2/f+1/4*(2*a-b)*b*tan(f*x+ e)^4/f+1/6*b^2*tan(f*x+e)^6/f
Time = 0.32 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.88 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {12 (a-b)^2 \log (\cos (e+f x))+6 (a-b)^2 \tan ^2(e+f x)+3 (2 a-b) b \tan ^4(e+f x)+2 b^2 \tan ^6(e+f x)}{12 f} \]
(12*(a - b)^2*Log[Cos[e + f*x]] + 6*(a - b)^2*Tan[e + f*x]^2 + 3*(2*a - b) *b*Tan[e + f*x]^4 + 2*b^2*Tan[e + f*x]^6)/(12*f)
Time = 0.29 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.96, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3042, 4153, 354, 86, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (e+f x)^3 \left (a+b \tan (e+f x)^2\right )^2dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle \frac {\int \frac {\tan ^3(e+f x) \left (b \tan ^2(e+f x)+a\right )^2}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 354 |
\(\displaystyle \frac {\int \frac {\tan ^2(e+f x) \left (b \tan ^2(e+f x)+a\right )^2}{\tan ^2(e+f x)+1}d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 86 |
\(\displaystyle \frac {\int \left (b^2 \tan ^4(e+f x)+(2 a-b) b \tan ^2(e+f x)+(a-b)^2-\frac {(a-b)^2}{\tan ^2(e+f x)+1}\right )d\tan ^2(e+f x)}{2 f}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {\frac {1}{2} b (2 a-b) \tan ^4(e+f x)+(a-b)^2 \tan ^2(e+f x)-(a-b)^2 \log \left (\tan ^2(e+f x)+1\right )+\frac {1}{3} b^2 \tan ^6(e+f x)}{2 f}\) |
(-((a - b)^2*Log[1 + Tan[e + f*x]^2]) + (a - b)^2*Tan[e + f*x]^2 + ((2*a - b)*b*Tan[e + f*x]^4)/2 + (b^2*Tan[e + f*x]^6)/3)/(2*f)
3.2.99.3.1 Defintions of rubi rules used
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ .), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 ] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S ymbol] :> Simp[1/2 Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x , x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ [(m - 1)/2]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Time = 0.08 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.10
method | result | size |
norman | \(\frac {b^{2} \tan \left (f x +e \right )^{6}}{6 f}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \tan \left (f x +e \right )^{2}}{2 f}+\frac {\left (2 a -b \right ) b \tan \left (f x +e \right )^{4}}{4 f}-\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f}\) | \(90\) |
derivativedivides | \(\frac {\frac {b^{2} \tan \left (f x +e \right )^{6}}{6}+\frac {a b \tan \left (f x +e \right )^{4}}{2}-\frac {b^{2} \tan \left (f x +e \right )^{4}}{4}+\frac {a^{2} \tan \left (f x +e \right )^{2}}{2}-\tan \left (f x +e \right )^{2} a b +\frac {b^{2} \tan \left (f x +e \right )^{2}}{2}+\frac {\left (-a^{2}+2 a b -b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}}{f}\) | \(110\) |
default | \(\frac {\frac {b^{2} \tan \left (f x +e \right )^{6}}{6}+\frac {a b \tan \left (f x +e \right )^{4}}{2}-\frac {b^{2} \tan \left (f x +e \right )^{4}}{4}+\frac {a^{2} \tan \left (f x +e \right )^{2}}{2}-\tan \left (f x +e \right )^{2} a b +\frac {b^{2} \tan \left (f x +e \right )^{2}}{2}+\frac {\left (-a^{2}+2 a b -b^{2}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}}{f}\) | \(110\) |
parts | \(\frac {a^{2} \left (\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {b^{2} \left (\frac {\tan \left (f x +e \right )^{6}}{6}-\frac {\tan \left (f x +e \right )^{4}}{4}+\frac {\tan \left (f x +e \right )^{2}}{2}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}+\frac {2 a b \left (\frac {\tan \left (f x +e \right )^{4}}{4}-\frac {\tan \left (f x +e \right )^{2}}{2}+\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}\right )}{f}\) | \(125\) |
parallelrisch | \(-\frac {-2 b^{2} \tan \left (f x +e \right )^{6}-6 a b \tan \left (f x +e \right )^{4}+3 b^{2} \tan \left (f x +e \right )^{4}-6 a^{2} \tan \left (f x +e \right )^{2}+12 \tan \left (f x +e \right )^{2} a b -6 b^{2} \tan \left (f x +e \right )^{2}+6 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a^{2}-12 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) a b +6 \ln \left (1+\tan \left (f x +e \right )^{2}\right ) b^{2}}{12 f}\) | \(130\) |
risch | \(-i a^{2} x +2 i a b x -i b^{2} x -\frac {2 i a^{2} e}{f}+\frac {4 i a b e}{f}-\frac {2 i b^{2} e}{f}+\frac {2 a^{2} {\mathrm e}^{10 i \left (f x +e \right )}-8 a b \,{\mathrm e}^{10 i \left (f x +e \right )}+6 b^{2} {\mathrm e}^{10 i \left (f x +e \right )}+8 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}-24 a b \,{\mathrm e}^{8 i \left (f x +e \right )}+12 b^{2} {\mathrm e}^{8 i \left (f x +e \right )}+12 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}-32 a b \,{\mathrm e}^{6 i \left (f x +e \right )}+\frac {68 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}}{3}+8 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}-24 a b \,{\mathrm e}^{4 i \left (f x +e \right )}+12 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+2 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}-8 a b \,{\mathrm e}^{2 i \left (f x +e \right )}+6 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{6}}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a^{2}}{f}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a b}{f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) b^{2}}{f}\) | \(332\) |
1/6*b^2*tan(f*x+e)^6/f+1/2*(a^2-2*a*b+b^2)/f*tan(f*x+e)^2+1/4*(2*a-b)*b*ta n(f*x+e)^4/f-1/2*(a^2-2*a*b+b^2)/f*ln(1+tan(f*x+e)^2)
Time = 0.27 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.05 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {2 \, b^{2} \tan \left (f x + e\right )^{6} + 3 \, {\left (2 \, a b - b^{2}\right )} \tan \left (f x + e\right )^{4} + 6 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{2} + 6 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{12 \, f} \]
1/12*(2*b^2*tan(f*x + e)^6 + 3*(2*a*b - b^2)*tan(f*x + e)^4 + 6*(a^2 - 2*a *b + b^2)*tan(f*x + e)^2 + 6*(a^2 - 2*a*b + b^2)*log(1/(tan(f*x + e)^2 + 1 )))/f
Leaf count of result is larger than twice the leaf count of optimal. 160 vs. \(2 (65) = 130\).
Time = 0.18 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.95 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\begin {cases} - \frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {a b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac {a b \tan ^{4}{\left (e + f x \right )}}{2 f} - \frac {a b \tan ^{2}{\left (e + f x \right )}}{f} - \frac {b^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b^{2} \tan ^{6}{\left (e + f x \right )}}{6 f} - \frac {b^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} + \frac {b^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \tan ^{3}{\left (e \right )} & \text {otherwise} \end {cases} \]
Piecewise((-a**2*log(tan(e + f*x)**2 + 1)/(2*f) + a**2*tan(e + f*x)**2/(2* f) + a*b*log(tan(e + f*x)**2 + 1)/f + a*b*tan(e + f*x)**4/(2*f) - a*b*tan( e + f*x)**2/f - b**2*log(tan(e + f*x)**2 + 1)/(2*f) + b**2*tan(e + f*x)**6 /(6*f) - b**2*tan(e + f*x)**4/(4*f) + b**2*tan(e + f*x)**2/(2*f), Ne(f, 0) ), (x*(a + b*tan(e)**2)**2*tan(e)**3, True))
Time = 0.23 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.55 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {6 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac {6 \, {\left (a^{2} - 4 \, a b + 3 \, b^{2}\right )} \sin \left (f x + e\right )^{4} - 3 \, {\left (4 \, a^{2} - 14 \, a b + 9 \, b^{2}\right )} \sin \left (f x + e\right )^{2} + 6 \, a^{2} - 18 \, a b + 11 \, b^{2}}{\sin \left (f x + e\right )^{6} - 3 \, \sin \left (f x + e\right )^{4} + 3 \, \sin \left (f x + e\right )^{2} - 1}}{12 \, f} \]
1/12*(6*(a^2 - 2*a*b + b^2)*log(sin(f*x + e)^2 - 1) - (6*(a^2 - 4*a*b + 3* b^2)*sin(f*x + e)^4 - 3*(4*a^2 - 14*a*b + 9*b^2)*sin(f*x + e)^2 + 6*a^2 - 18*a*b + 11*b^2)/(sin(f*x + e)^6 - 3*sin(f*x + e)^4 + 3*sin(f*x + e)^2 - 1 ))/f
Leaf count of result is larger than twice the leaf count of optimal. 2205 vs. \(2 (76) = 152\).
Time = 4.15 (sec) , antiderivative size = 2205, normalized size of antiderivative = 26.89 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\text {Too large to display} \]
1/12*(6*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^ 2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 - 12*a*b*log( 4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan (f*x)^2 + tan(e)^2 + 1))*tan(f*x)^6*tan(e)^6 + 6*b^2*log(4*(tan(f*x)^2*tan (e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^ 2 + 1))*tan(f*x)^6*tan(e)^6 + 6*a^2*tan(f*x)^6*tan(e)^6 - 18*a*b*tan(f*x)^ 6*tan(e)^6 + 11*b^2*tan(f*x)^6*tan(e)^6 - 36*a^2*log(4*(tan(f*x)^2*tan(e)^ 2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5 + 72*a*b*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*t an(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^5*t an(e)^5 - 36*b^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan( f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^5*tan(e)^5 + 6*a^2* tan(f*x)^6*tan(e)^4 - 12*a*b*tan(f*x)^6*tan(e)^4 + 6*b^2*tan(f*x)^6*tan(e) ^4 - 24*a^2*tan(f*x)^5*tan(e)^5 + 84*a*b*tan(f*x)^5*tan(e)^5 - 54*b^2*tan( f*x)^5*tan(e)^5 + 6*a^2*tan(f*x)^4*tan(e)^6 - 12*a*b*tan(f*x)^4*tan(e)^6 + 6*b^2*tan(f*x)^4*tan(e)^6 + 90*a^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x )*tan(e) + 1)/(tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^ 4*tan(e)^4 - 180*a*b*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/( tan(f*x)^2*tan(e)^2 + tan(f*x)^2 + tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 90 *b^2*log(4*(tan(f*x)^2*tan(e)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(f*x)^2*ta...
Time = 11.29 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.18 \[ \int \tan ^3(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx=\frac {{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {a\,b}{2}-\frac {b^2}{4}\right )}{f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^6}{6\,f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{f} \]